#include <stdio,h>
#include <stdlib.h>
#include <string.h>
#include "bonc.h"
char string_copy(string s)//复制
{
  string t=(char *)malloc(sizeof(s));
  t = s;
  return t;
}

char string_add(string &s,string &t)//追加
{
  s = (char * )relloc(sizeof(s)+sizeof(t));
  s+=t;
  return s;
}

char string_sort(string &s)//排序
{
  char interim;
  for(int i = 0;i<strlen(s);i++)
  {
    for(j = i+1;j<strlen(s)-i;j++)
    {
      if(s[i]>s[j])
      {
        interim=s[i];
        s[i]=s[j];
        s[j]=interim;
      }
    }
 }
  return s;
}

void String_free(string &s)//释放
{
  free(s);
}

char string_find(string s,char target)//查找
{
  for(int i=0;i<strlen(s);i++)
  {
    if(s[i]==target)
    {
    return 0;
    }
    return 1;
  }
}

void string_print(string s)//打印
{
  int i=0,j=0;
  for(i=0;i<strlen(s);i++)
  {
    bonc_print_in("%c",s[i]);
    if(i%3==0&&i!=0)
    {
    bonc_print_in(",");
    }
  }
}
